Skip to content

nmc(PB): name-operation relay path + fee flow into template - #402

Merged
frstrtr merged 1 commit into
masterfrom
nmc/pb-name-relay
Jun 24, 2026
Merged

nmc(PB): name-operation relay path + fee flow into template#402
frstrtr merged 1 commit into
masterfrom
nmc/pb-name-relay

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

NMC P1 PB — name-operation relay path + fee flow

§4 review CLEARED (integrator, all 3 open items accepted). Cuts NMC PB.

Adds the one NMC tx-class with no BTC/DOGE analog: the Namecoin name operations (name_new / name_firstupdate / name_update). c2pool is a merge-miner, not a name registry, so name txs are relayed into the block template WITHOUT name-db consensus validation — SPV-trust in the configured namecoind backend; namecoind owns name-db consensus.

Changes (src/impl/nmc/ only — per-coin isolation, btc tree read-only)

  • coin/mempool.hpp
    • classify_name_op() — version-marker (getNamecoinVersion() == 0x7100) and a leading name opcode (OP_1/OP_2/OP_3) on an output script. The version gate is the false-positive guard: a bare OP_1..OP_3 output in a plain Bitcoin-version tx (taproot / segwit-v1 / bare multisig) is not classified as a name op.
    • MempoolEntry carries NameOp + TxSource provenance (Daemon-trusted vs PeerRelay) — the SPV-trust boundary. name_op_count() / trusted_name_op_count() queries.
    • Name-tx fees flow through the existing get_sorted_txs_with_fees → coinbasevalue path unchanged — name ops are NOT special-cased in payout (Bitcoin subsidy schedule).
  • test/nmc_mempool_name_test.cpp — 9 KATs: classify (incl. false-positive guard + wrong-version + name-version-without-name-script), admission + provenance tagging, and a name-tx fee reaching the template coinbasevalue (subsidy(2) + 7000).
  • test/CMakeLists.txt + build.ymlnmc_mempool_name_test registered in CMake and both allowlist lines (avoids a dgb: conform subsidy to p2pool-dgb-scrypt oracle (COIN=1e6, weeks+1) [COMPAT] #137 NOT_BUILT sentinel).

Local verification

  • nmc_mempool_name_test9/9 PASS
  • nmc_template_builder_test (existing mempool consumer, after the mempool.hpp edits) — 17/17 PASS, no regression

Deferred to PF (per §4 — caveats, not PB blockers)

  1. Bind name-op trust to the daemon source (PeerRelay name txs admitted but not trusted).
  2. v36 short-circuit (if constexpr ShareT::version < 36 return {}) so NMC merged work can't mint on a pre-v36 BTC share.
  3. Assert no aux-slot collision across the registered vector<AuxChain> at actual tree size.

P1 PB for embedded merge-mined Namecoin. Adds the one NMC tx-class with no
BTC/DOGE analog: the name operations (name_new / name_firstupdate /
name_update). c2pool is a merge-miner, not a name registry, so name txs are
RELAYED into the block template WITHOUT name-db consensus validation
(SPV-trust in the configured namecoind backend; namecoind owns name-db
consensus).

- coin/mempool.hpp: classify_name_op() (version-marker + leading name opcode,
  with a false-positive guard against bare OP_1..OP_3 segwit/multisig outputs
  in plain Bitcoin-version txs); MempoolEntry carries NameOp + TxSource
  provenance (daemon-trusted vs peer-relay, the SPV-trust boundary);
  name_op_count() / trusted_name_op_count() queries. Name-tx fees flow through
  the existing get_sorted_txs_with_fees -> coinbasevalue path unchanged (name
  ops are NOT special-cased in payout; Bitcoin subsidy schedule).
- test/nmc_mempool_name_test.cpp: 9 KATs (classify incl. false-positive guard,
  admission + provenance tagging, fee reaching template coinbasevalue).
- Registered in test/CMakeLists.txt + build.yml allowlist (both lines) to
  avoid a #137 NOT_BUILT sentinel.

Per-coin isolation: src/impl/nmc/ only; btc tree consumed read-only. The three
§4 PF caveats (bind trust to daemon source; v36 short-circuit; aux-slot
distinctness) are folded into the PF KAT slice, not gated on PB.
@frstrtr
frstrtr force-pushed the nmc/pb-name-relay branch from 6c6bcd5 to 9246e71 Compare June 24, 2026 05:31
@frstrtr
frstrtr merged commit e6e0d6d into master Jun 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant